import request from '../utils/request';

//公共插入方法
export async function insert(params) {
  return request('/api/common/insert',{
    method:'post',
    body:JSON.stringify(params)
  });
}
//公共删除方法
export async function deleted(params) {
  return request('/api/common/delete',{
    method:'post',
    body:JSON.stringify(params)
  });
}
//公共更新方法
export async function update(params) {
  return request('/api/common/update',{
    method:'post',
    body:JSON.stringify(params)
  });
}
// 公共查询方法(数据源)
export async function source(params) {
  if(params.in) {
    return request('/in/api/common/select/source',{
      method:'post',
      body:JSON.stringify(params)
    });
  }else {
    return request('/api/common/select/source',{
      method:'post',
      body:JSON.stringify(params)
    });
  }
}
// 数据源组件公共查询方法
export async function components(params) {
  return request('/api/common/components',{
    method:'post',
    body:JSON.stringify(params)
  });
}
